home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Headers / MACDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  7.2 KB  |  270 lines  |  [TEXT/????]

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * macdef.h -     MAC specific definitions. All grouped here for reference.      *
  4. *                                                                             *
  5. *               OLE Version 2.0                                               *
  6. *                                                                             *
  7. *               Copyright (c) 1992-1994, Microsoft Corp. All rights reserved. *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11.  
  12. #if !defined(__MACDEF__) && !defined(_MACDEF_H_)
  13. #define __MACDEF__
  14. #define _MACDEF_H_
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20.  
  21. /* Predefined Clipboard Formats */
  22.  
  23.  
  24. #define cfPict          'PICT'
  25. #define cfText          'TEXT'
  26. #define cfOwnerLink     'OLNK'          /* ole clip formats */
  27. #define cfObjectLink    'OJLK'
  28. #define cfLink          'LINK'
  29. #define cfNative        'NATV'
  30. #define cfBinary        'BINA'
  31. #define cfFileName      'FNAM'
  32. #define cfNetworkName   'NETN'
  33. #define cfClap          'CLAP'
  34. #define    cfTransferDesc    'TNAM'
  35. #define    cfDataObject    'DOBJ'
  36. #define cfDataObjectSig 'DSIG'
  37. #define    cfEmbeddedObject 'EMBO'
  38. #define    cfEmbedSource     'EMBS'
  39. #define    cfLinkSource     'LNKS'
  40. #define    cfOleDraw         'DRAW'
  41. #define    cfLinkSrcDescriptor         'LKSD'
  42. #define    cfObjectDescriptor         'OBJD'
  43. #define cfOle10Native   'OLE1'          /* Mac format tag of IStorages with "\1Ole10Native" streams */
  44.  
  45. #define typeDDE         'DDE '
  46. #define typeRNCF        'RNCF'
  47. #define typeEMBD        'EMBD'
  48.  
  49.  
  50. typedef struct tagColorEntry {
  51.     Byte    red;
  52.     Byte    green;
  53.     Byte    blue;
  54.     Byte    flags;
  55. } ColorEntry;
  56. typedef ColorEntry  *LPColorEntry;
  57.  
  58. // Color scheme table
  59. typedef struct tagOLECOLORSCHEME {
  60.     short        version;
  61.     short        numEntries;
  62.     ColorEntry    oleColor[1];
  63. } OLECOLORSCHEME;
  64. typedef OLECOLORSCHEME        *LPOLECOLORSCHEME;
  65.  
  66. #if !defined(LOGPALETTE) && !defined(WLM)
  67.  
  68. #define LOGPALETTE            OLECOLORSCHEME
  69. #define LPLOGPALETTE        LPOLECOLORSCHEME
  70.  
  71. #endif    // !LOGPALETTE
  72.  
  73. // Registration database API's etc.
  74.  
  75.  
  76. /* return codes from win 3.1 Registration functions */
  77. /* Retained for compatibility reasons */
  78.  
  79. #ifndef  ERROR_SUCCESS           
  80. #define ERROR_SUCCESS           0L
  81. #endif
  82.  
  83. #ifndef  ERROR_BADDB             
  84. #define ERROR_BADDB             1L
  85. #endif
  86.  
  87. #ifndef  ERROR_BADKEY            
  88. #define ERROR_BADKEY            2L
  89. #endif
  90.  
  91. #ifndef  ERROR_CANTOPEN          
  92. #define ERROR_CANTOPEN          3L
  93. #endif
  94.  
  95. #ifndef  ERROR_CANTREAD          
  96. #define ERROR_CANTREAD          4L
  97. #endif
  98.  
  99. #ifndef  ERROR_CANTWRITE         
  100. #define ERROR_CANTWRITE         5L
  101. #endif
  102.  
  103. #ifndef  ERROR_OUTOFMEMORY       
  104. #define ERROR_OUTOFMEMORY       6L
  105. #endif
  106.  
  107. #ifndef  ERROR_INVALID_PARAMETER 
  108. #define ERROR_INVALID_PARAMETER 7L
  109. #endif
  110.  
  111. #ifndef  ERROR_ACCESS_DENIED     
  112. #define ERROR_ACCESS_DENIED     8L
  113. #endif
  114.  
  115.  
  116. /* new  error codes / or new error code names */
  117.  
  118. #ifndef  ERROR_INSUFFICIENT_MEMORY    
  119. #define ERROR_INSUFFICIENT_MEMORY    10L
  120. #endif
  121.  
  122.  
  123. #ifndef  ERROR_CANNOT_OPEN_REGFILE    
  124. #define ERROR_VALUE_NOT_FOUND        9L
  125.  
  126. #define ERROR_CANNOT_OPEN_REGFILE    11L
  127. #define ERROR_REGFILE_READERROR        12L
  128. #define ERROR_REGFILE_WRITEERROR    13L
  129. #define ERROR_REGKEY_NOTFOUND        14L
  130. #define ERROR_REGKEY_INVALIDKEY        15L
  131. #define    ERROR_REG_BUFFER_OVERFLOW    16L
  132.         // same as insufficient memory
  133. #define    ERROR_REGKEY_CANNOT_DELETE    17L
  134.  
  135. #endif
  136.  
  137.  
  138.  
  139. // REGENUMPROGIDF; flags indicating the status of a subkey returned
  140. // from RegEnumProgID.
  141. typedef enum tagREGENUMPROGIDF
  142. {
  143.     REGENUMPROGIDF_ISPROGID        = 1,   // RegEnumProgID returned subkey that is a ProgID
  144.     REGENUMPROGIDF_EMBPREF          = 2,   // RegEnumProgID returned subkey from Embedding Pref file
  145.     REGENUMPROGIDF_INSERTABLE    = 4    // RegEnumProgID returned a ProgID that is Insertable
  146.     ,REGENUMPROGIDF_FORCELONG    =    2147483647
  147. } REGENUMPROGIDF;
  148.   
  149. typedef long    OLELONG;
  150.  
  151. // Server Registration API
  152.  
  153. typedef enum {
  154.     OLEREG_OK,                      // Function operated correctly
  155.     OLEREG_ERROR_SUCCESS = OLEREG_OK,
  156.     OLEREG_INVALID_KEY,                // invalid reg db key to close reg
  157.     OLEREG_INVALID_KEYWORD,            // invalid reg db keyword to query/set reg
  158.     
  159.     OLEREG_ITEM_NOT_FOUND,        
  160.     OLEREG_INDEX_NOT_FOUND,            // index in item list not exist
  161.     OLEREG_ENUM_DONE = OLEREG_INDEX_NOT_FOUND,        // enumeration done    
  162.     
  163.     OLEREG_REG_NOT_OPEN,            // reg not open when calling close reg
  164.     OLEREG_DB_NOT_FOUND,            // emb pref file not found
  165.     OLEREG_DB_LOCKED,                // emb pref file locked by another app
  166.     OLEREG_DB_ERROR,                 // emb pref file error while opening/reading/writing
  167.     OLEREG_ERR_MEMORY,                // insuff. or bad memory operation
  168.     OLEREG_DB_BADFORM,                // reg db has invalid entries
  169.     OLEREG_FILE_NOT_FOUND,            // specified file not found
  170.  
  171.     //......more codes here,          // 
  172.  
  173.  
  174.     OLEREG_ERR_GENERIC,                // some general error
  175.     OLEREG_ERR_BUFFER_SIZE,            // buffer to set data illegitimate size
  176.     OLEREG_ERR_NO_INIT,            // buffer to set data illegitimate size
  177.     OLEREG_ERROR_BADKEY    = 2,
  178.     OLEREGSTATUS_FORCELONG    =    2147483647
  179.     
  180. } OLEREGSTATUS;
  181.  
  182.  
  183.  
  184. typedef char *  OLEREG_VALUE;
  185. typedef long    OLEREG_HKEY;
  186.  
  187. typedef enum {
  188.     OLEREG_ROOT,            
  189.     OLEREG_GENERIC,
  190.       
  191.     OLEREGSVR_CLASS,         
  192.     OLEREGSVR_HUMAN_READABLE,
  193.     OLEREGSVR_EXTENSION,                           // win
  194.     OLEREGSVR_FILE_TYPE,                        // mac
  195. //    OLEREGSVR_FILE_TYPE = OLEREGSVR_EXTENSION,    // mac
  196.     OLEREGSVR_PROTOCOL,      
  197.     OLEREGSVR_SERVER,                           // win
  198.     OLEREGSVR_SIGNATURE = OLEREGSVR_SERVER,        // mac
  199.     OLEREGSVR_HANDLER,             
  200.     OLEREGSVR_VERB,    
  201.     OLEREGSVR_NET_DRIVE,        // network volume for server
  202.  
  203.  
  204.                                 // The following keywords can only
  205.     OLEREG_QUERY_ONLY = 2000, // be used with OleregGetValue()
  206.     OLEREGSVR_CLASS_FROM_HUMAN_READABLE,
  207.     OLEREGSVR_CLASS_FROM_EXTENSION,           // win
  208.     OLEREGSVR_CLASS_FROM_SIG = OLEREGSVR_CLASS_FROM_EXTENSION    // mac
  209.     ,OLEREG_KEYWORD_FORCELONG    =    2147483647
  210. } OLEREG_KEYWORD;
  211.  
  212. // this const used by OleregRemoveKey to delete all items of a list.
  213. #define    REG_ALL_INDEXES    0xFFFFFFFF
  214.  
  215. typedef enum {
  216.     REG_APPEND,                    // 0 add to end of list
  217.     REG_IGNORE = REG_APPEND,    // 0 parameter not used
  218.     REG_INSERT,                    // 1 insert at front of list
  219.     REG_REPLACE,                // 2 replace all previous entries w/ new one
  220.     REG_DELETE = REG_REPLACE    // 2 replace all previous entries w/ new one
  221.     ,OLEREG_ORDER_FORCELONG    =    2147483647
  222. } OLEREG_ORDER;
  223.  
  224.  
  225. #define OLEICON_CCHKEYMAX        256 
  226. #define OLEICON_CCHPATHMAX        256 
  227. #define OLEICON_CCHLABELMAX        40
  228. #define OLEICON_CCHDBENTRYMAX    256
  229.  
  230. // This is the OleIconSource structure returned by OleUIPictExtractIconSource
  231. //    For an explanation of its use, consult {stdimpl}IconSrc.h
  232. typedef enum { FileAndResIDMethod, 
  233.                 CreatorAndIndexMethod,
  234.                 CreatorAndTypeMethod,
  235.                 SystemResIDMethod 
  236. } IconRetrievalMethod ;
  237.     
  238. typedef struct {
  239.     IconRetrievalMethod method;
  240.  
  241.     union {
  242.         struct {
  243.             char     szPathname[OLEICON_CCHPATHMAX];
  244.             long     lFileID;
  245.             short    sResID;
  246.         } FileAndResIDStruct;
  247.         
  248.         struct {
  249.             OSType    lCreator;
  250.             short    sIndex;
  251.         } CreatorAndIndexStruct;
  252.         
  253.         struct {
  254.             OSType lCreator;
  255.             OSType lType;
  256.         } CreatorAndTypeStruct;
  257.         
  258.         struct {
  259.             short sResID;
  260.         } SystemResIDStruct;
  261.         
  262.     } IconSourceUnion;
  263. } OleIconSource;
  264.  
  265. #ifdef __cplusplus
  266. }
  267. #endif
  268.  
  269. #endif /* __MACDEF__ */
  270.